home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
16
/
index.fth
< prev
next >
Wrap
Text File
|
1985-11-19
|
1KB
|
53 lines
\ Recreate the index file for the WHATIS database. This is necessary
\ if you modify the WHATIS.DOC file.
\
\ make-index whatis.doc Generate the new index
\ write-index whatis.ind Write it to disk
decimal
only forth hidden also forth definitions
variable last-char
: dropline ( -- )
delimiter @ newline <>
if
pad newline ifd @ getcword drop
delimiter off
then
;
: set-index ( position char -- )
dup last-char @ <> ( position char flag )
if dup last-char !
32 - index swap na+ !
else 2drop
then
;
: 1line ( -- end? )
ifd @ ftell ( pos )
pad ifd @ getword ( pos str )
delimiter @ eof =
if 2drop true
else 1+ c@ set-index
dropline dropline
false
then
;
: make-index ( -- ) \ filename
reading
index /index th ff fill
last-char off
begin 1line until
ifd @ close
;
: write-index ( -- ) \ filename
writing
index /index ofd @ fputs
ofd @ close
;
only forth also definitions
forth also definitions
: label \ name ( -- )
create !csp
assembler [ assembler ] normal
;
: interpre